/**
 *   \file get_domain_capabilities.c
 *   \brief gcc -o get_domain_capabilities get_domain_capabilities.c -lvirt
 *
 *  Detailed description
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <libvirt/libvirt.h>

int main(int argc, char *argv[])
{
    virConnectPtr  conn;
    char          *emulateion;
    char          *arch;
    char          *machine;
    char          *virttype;
    char          *ret;
    unsigned int   flags = 0;


    conn = virConnectOpen("qemu:///system");
    if (conn == NULL) {
      fprintf(stderr, "Failed to open connection to qemu:///system\n");
      return 1;
    }

    ret = virConnectGetDomainCapabilities(conn,
                                          &emulateion,
                                          &arch,
                                          &machine,
                                          &virttype,
                                          (void *)0);
    printf("%s\n", ret);

    virConnectClose(conn);
    return 0;
}
